package com.service.firstapp.controller;

import org.apache.servicecomb.core.Invocation;
import org.apache.servicecomb.core.handler.impl.AbstractHandler;
import org.apache.servicecomb.swagger.invocation.AsyncResponse;

/**
 * Created by bear on 2018/3/15.
 */
public class MyHandler extends AbstractHandler {
    @Override
    public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception {

        System.out.println("code before");
        invocation.next(response -> {
            System.out.println("code after1");
            asyncResp.handle(response);
            response.setResult("sss");
            //response.setStatus(Response.OK);
            System.out.println("code after2");
        });
    }
}